<?php

namespace App\Observers;

use App\Jobs\SendFangownerMail;
use App\Models\Fangowner;
use Mail;
use Illuminate\Mail\Message;
class FangownerObserver
{
    public function created(Fangowner $fangowner){
//        Mail::raw("恭喜您在本平台添加成功，我们后续为您服务!",function(Message $message) use ($fangowner){
//            $message->to($fangowner->email,$fangowner->name);
//            $message->subject("添加成功通知");
//        });
        dispatch(new SendFangownerMail($fangowner));
    }
}
